package com.example.springboot.controller;


import com.example.springboot.base.Result;
import com.example.springboot.service.FolderFileInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 赵久燚
 * @since 2022-07-11 19:45:42
 */
@RestController
@Api(tags = "文件夹")
@RequestMapping("/folder")
public class FolderFileInfoController {

    @Autowired
    private FolderFileInfoService folderFileInfoService;

    @ApiOperation("获取文件夹内容")
    @PostMapping("/getContent")
    public Result getFolderContent(@RequestParam("folderId") String folderId){
        return folderFileInfoService.getFolderContent(folderId);
    }

    @PostMapping("/createFolder")
    @ApiOperation("创建文件夹")
    public Result createFolder(
            @RequestParam("folderId") String folderId,
            @RequestParam("folderName") String folderName
    ){
        return folderFileInfoService.createFolder(folderId,folderName);

    }

    @PostMapping("/deleteFolder")
    @ApiOperation("删除文件夹")
    public Result deleteFolder(
            @RequestParam("folderId") String folderId
    ){
        return folderFileInfoService.deleteFolder(folderId);

    }

    @PostMapping("/recycle")
    @ApiOperation("回收站")
    public Result Recycle(
            @RequestParam("folderId") String folderId
    ){
        return null;

    }



}

